package com.wx.springboot.step5.exception;

import com.wx.springboot.step5.common.api.IErrorCode;

/**
 * 自定义异常
 */
public class ApiException extends RuntimeException {
    private IErrorCode iErrorCode;

    public ApiException(IErrorCode iErrorCode) {
        super(iErrorCode.getMessage());
        this.iErrorCode = iErrorCode;
    }

    public ApiException(String message) {
        super(message);
    }

    public ApiException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApiException(Throwable cause) {
        super(cause);
    }

    public IErrorCode getErrorCode() {
        return iErrorCode;
    }

}
